From e4d5b8151802517b2943756fc0d09ffa95e2c4e2 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 29 Jan 2022 18:21:37 +0100 Subject: chore: replace lingui functions with react-intl --- src/pages/thematique/[slug].tsx | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/pages/thematique/[slug].tsx') diff --git a/src/pages/thematique/[slug].tsx b/src/pages/thematique/[slug].tsx index d263ee9..61019fd 100644 --- a/src/pages/thematique/[slug].tsx +++ b/src/pages/thematique/[slug].tsx @@ -4,7 +4,6 @@ import PostPreview from '@components/PostPreview/PostPreview'; import Sidebar from '@components/Sidebar/Sidebar'; import { RelatedTopics, ThematicsList, ToC } from '@components/Widgets'; import { config } from '@config/website'; -import { t } from '@lingui/macro'; import { getAllThematicsSlug, getThematicBySlug, @@ -19,9 +18,11 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { ParsedUrlQuery } from 'querystring'; import { useRef } from 'react'; +import { useIntl } from 'react-intl'; import { Article, Graph, WebPage } from 'schema-dts'; const Thematic: NextPageWithLayout = ({ thematic }) => { + const intl = useIntl(); const relatedTopics = useRef([]); const router = useRouter(); @@ -118,14 +119,27 @@ const Thematic: NextPageWithLayout = ({ thematic }) => {
{thematic.posts.length > 0 && (
-

{t`All posts in ${thematic.title}`}

+

+ {intl.formatMessage( + { + defaultMessage: 'All posts in {name}', + description: 'ThematicPage: posts list title', + }, + { name: thematic.title } + )} +

    {getPostsList()}
)} - + -- cgit v1.2.3